{% extends "data_list.html" %} {% load i18n %} {% block search_div %} {% endblock %} {% block getdatalist %} {% endblock %} {% block addjs %} $(".portlet").removeClass("floatL").css({width:"73%",float:"right"}); $("#id_main_div").before("
" +"

" +"{% trans '区域' %}" +"

" +"" +"{% trans '显示全部设备' %}" +"" +"
" +"
" +"
" ) var after_init=function(){ $("#id_span_title").css({"margin-left":"120px"}); $('#id_area_select').parent(".div_box").hide(); $("#id_main_div").css({width:"100%",float:"right"}); return true; } var after_close=function(){ $("body").removeClass("indexBody").css("width","auto"); $(".rightBox").eq(1).attr("class","rightBox1"); $('#id_area_select').parent(".div_box").show(); $("#id_main_div").css({width:"73%",float:"right"}); return true; } var after_submit=function(){ $("body").removeClass("indexBody").css("width","auto"); $(".rightBox").eq(1).attr("class","rightBox1"); $('#id_area_select').parent(".div_box").show(); $("#id_main_div").css({width:"73%",float:"right"}); return true; } var data=[] $(function(){ $("body").removeClass("indexBody").css("width","auto"); $(".rightBox").eq(1).attr("class","rightBox1"); $("#div_id_middiv").hide(); $(".leftBoxMiddle").hide(); {%if "SECURITY_AND_ZKECO"|filter_config_option%}//安防一卡通对接情况下特殊处理 model_actions = true obj_edit = true row_operations = ["op_edit","_delete",] disabled_actions = ['_change','OpCtrlAuxOut','OpUpEmpInfo','OpSearchACPanel','ClearData','ClearPosData','OpReloadICPOSData','Pause','PowerSuspend','ResetPassword','Resume','SyncACPanelTime','OpChangeIPOfACPanel','OpBrowseLog','UploadLogs','OpEnableDevice','OpDisableDevice','OpUpgradeFirmware','OpChangeMThreshold','OpCloseAuxOut','OpSetDSTime','OpRemoveDSTime','UploadUserInfo','OpChangeBaudrate','OpChangeElevatorParamters','OpDisableAccPush','OpEnableAccPush','IcPosOnlineReloadData','OpIcDeviceDataCheck','',''] {%else%} model_actions = false obj_edit = false row_operations = ["op_edit","_delete",] disabled_actions = ['_change','OpCtrlAuxOut','OpUpEmpInfo','ClearData','ClearPosData','OpReloadICPOSData','Pause','PowerSuspend','ResetPassword','_delete','Resume','Syncdata','SyncACPanelTime','OpChangeIPOfACPanel','OpBrowseLog','UploadLogs','OpEnableDevice','OpDisableDevice','OpUpgradeFirmware','OpChangeMThreshold','OpCloseAuxOut','OpSetDSTime','OpRemoveDSTime','UploadUserInfo','OpChangeBaudrate','OpChangeElevatorParamters','OpDisableAccPush','OpEnableAccPush','IcPosOnlineReloadData','OpIcDeviceDataCheck','',''] {%endif%} {% if request.user|HasPerm:"contenttypes.can_AttDeviceDataManage" %} $('#id_datalist').model_grid( { 'model_url':'{{dbapp_url}}iclock/Device/?device_type__exact=1&ref_model=att.AttDeviceDataManage', 'model_actions':model_actions, 'object_actions':true, 'obj_edit':obj_edit, 'row_operations':row_operations, 'disable_cols':['comm_type','Fpversion','show_com_port_address_baudrate','acpanel_type','device_use_type','dining.name','consume_model','com_port','com_address','show_enabled|boolean_icon','show_fp_mthreshold','get_dstime_name','device_type','fw_version','pos_dev_status|boolean_icon','pos_file_count','pos_cmd_count'], 'need_plus_sign':false, 'multiple_select':true, 'init_after_get_jdata':function(){ $("#id_datalist").get(0).g.a_div.after("
"); var $app_menu=$("#id_datalist").get(0).g.a_div; var $menu_more=$(".action_more_list"); var min_width=$("#id_datalist").width()-500; resize_menu($app_menu,$menu_more,min_width,"id_action_more"); $(".div_leftBottomLine").hide() $('.nav li').sfHover(); {% block extrajs %}{% endblock %} $("#id_datalist").on_dbl_click(function(grid, key, row_data){ //双击 var device_sn = $($("#id_datalist tr[data="+row_data+"]").find("td")[2]).text(); var href= "/{{request.surl}}att/fetch_cmds/?sn="+device_sn+""; var html = ""; $.ajax({ url:href, dataType:"json", type:"post", success:function(ret){ html = '' for(var cmd in ret.cmds) html+=""+ (cmd) +""+ (ret.cmds[cmd]) +""; var vbox=$("
" + "
" +"" +"" + html + "
{% trans '序号' %}{% trans '待处理命令:最新(' %}"+(ret.length)+"{% trans ')条' %}
" + "
"); vbox.dialog({title:gettext("设备序列号:")+ret.sn+" "}); } }); }); }, 'disabled_actions':disabled_actions }) var listDiv="" data=$("#id_datalist").get(0).g.data $.ajax({ type: "POST", url:"../../data/personnel/Area/choice_data_widget?areatree=True", dataType:"html", success:function(json){ $("#id_area_select").hide().html(json).show(); // $('#id_AreaSelect p').click(function(){ // var vItem = $(this).parent().attr("id") // $('#id_datalist').get(0).g.base_query=["area__exact="+vItem] // $('#id_datalist').get(0).g.load_data() // }) //$("#AreaAdjust").find("#id_area_select").css({height:$("#id_datalist").height()+44}); } }); $("#id_queryall").click(function(){ $("#id_AreaSelect").find("p[class*='s']").attr("class","t") $("#id_area_select").find("input[type='hidden']").attr("value","") $('#id_datalist').get(0).g.init_query=[] $('#id_datalist').get(0).g.base_query=["device_type__exact=1"] $('#id_datalist').get(0).g.load_data() }) {% endif %} // $("input[name='rdo_style']").click(function(){ // var v=$(this).val(); // if(v==1) // { // $(this).parent().parent().find("#id_tbl").removeClass("displayN"); // $("#id_datalist_view").css("display","None"); // // } // else // { // //if($("#id_datalist_view").length>0) // $("#id_datalist_view").remove(); // listDiv=showBox(data); // // $(this).parent().parent().append(listDiv); // $(this).parent().parent().find("#id_tbl").addClass("displayN"); // // } // }); }); //function view_edit(obj) //{ // var Href=$(obj).attr("alt"); // // $.zk._processEdit(Href, $("#id_datalist").get(0), undefined, $(obj)); // $("#id_datalist_view").css("display","None"); // $("#id_datalist_view").parent().find("#id_tbl").removeClass("displayN"); // return false; // //} //添加查询条件 function before_query(strwhere){ strwhere.push("device_type__exact=1"); return strwhere; } //function showBox(data) //{ // var html=""; // if(data.length>0) // { // html+="
" // for(var i=0;i" // // +"" // +"
" // +""+data[i][0]+"
" // +"{%trans "区域" %}:"+data[i][2]+"
" // +"{%trans "状态" %}:"+data[i][7]+"
" // //+"{%trans "数据维护" %}:"+data[i]+"" // // // +'
' // +"
" // } // html+="" // // } // else // html+="
{%trans "没有设备!" %}
" // return html; // //} //function getMoreInfo(index){ // return "
{% trans "设备名称" %}:"+(data[index][8]=="None"?"":data[index][8]) // +"
{% trans "设备别名" %}:"+data[index][1] // +"
{% trans "传送时间" %}:"+data[index][4] // +"
{% trans "刷新间隔时间" %}:"+data[index][5] // +"
{% trans "最近联机时间" %}:"+data[index][6] // +"
{% trans "固件版本" %}:"+(data[index][8]=="None"?"":data[index][8]) // +"
{% trans "用户数" %}:"+(data[index][10]=="None"?"":data[index][10]) // +"
{% trans "指纹数" %}:"+(data[index][11]=="None"?"":data[index][11]) // +"
{% trans "记录数" %}:"+(data[index][12]=="None"?"":data[index][12]) // +"
" //} //function index_tip_info(obj) //{ // //alert(obj); // var index=$(obj).attr("index"); // // $("#id_tip").html(getMoreInfo(index)); // var offset=$(obj).offset(); // if($("#id_tip").css("display")=="none"){ // $("#id_tip").css({"z-index":"16","display":"block","position":"absolute","top":(offset.top+70),"left":(offset.left-70)}) // $("#id_tip").mouseover(function(){ // $(this).css({"z-index":"16","display":"block","position":"absolute","top":(offset.top+70),"left":(offset.left-70)}) // // }).mouseout(function(){ // $("#id_tip").css("display","none"); // }); // } // else // $("#id_tip").css("display","none"); // $(".maskIframe").css("width",$(".div_tip").width()+14); // $(".maskIframe").css("height",$(".div_tip").height()+14); //} //function tip_info_exit() //{ // $("#id_tip").css("display","none") //} function reflash_child_area_list(event, treeId, treeNode){ var parent_id = treeNode.id; var strwhere=[]; strwhere = before_query(strwhere) strwhere.push("area__id__exact="+parent_id); var $grid = $('#id_datalist'); var datalist=$grid.get(0); datalist.g.init_query=strwhere; datalist.g.load_data(); } {% endblock %} {% block addmiddiv %} {% if request.user|HasPerm:"contenttypes.can_AttDeviceDataManage" %}
{% trans '显示方式' %} {% trans '列表方式' %} {% trans '图表方式' %}
{% else %}
{% trans '用户无设备浏览权限,请与管理员联系' %}
{% endif %} {% endblock %}